﻿// -----------------------------------------------------------------------
// <copyright file="QualityOfService.cs" company="Zen Design Corp">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Zen.BlackBerry.Pap
{
	using System.Xml.Serialization;

	/// <summary>
	/// Represents the quality of service attributes for a PAP push message.
	/// </summary>
	public class QualityOfService
	{
		/// <summary>
		/// Gets or sets the delivery method.
		/// </summary>
		/// <value>The delivery method.</value>
		[XmlAttribute(AttributeName = "delivery-method")]
		public DeliveryMethod DeliveryMethod
		{
			get;
			set;
		}
	}

	/// <summary>
	/// Defines the type of reliability to use for message delivery.
	/// </summary>
	public enum DeliveryMethod
	{
		/// <summary>
		/// Signifies that client confirmation of the message delivery is
		/// available.
		/// </summary>
		[XmlEnum("confirmed")]
		Confirmed = 0,

		/// <summary>
		/// Signifies that client confirmation of the message delivery is not
		/// available.
		/// </summary>
		[XmlEnum("unconfirmed")]
		Unconfirmed = 1,

		/// <summary>
		/// Signifies that the PPG should try to deliver the message as confirmed,
		/// but may use another method if not able to use the preferred choice.
		/// </summary>
		[XmlEnum("preferconfirmed")]
		PreferConfirmed = 2,

		/// <summary>
		/// Signifies that there is not preference between confirmed and
		/// unconfirmed delivery of the message.
		/// </summary>
		[XmlEnum("notspecified")]
		NotSpecified = 3
	}
}
